# Five imports
from Products.Five.browser import BrowserView

# easyarticle imports
from easyarticle.core.interfaces import IObjectsManagement

class ArticleView(BrowserView):
    """
    """ 
    def getObjects(self):
        """
        """
        objects = []
        om = IObjectsManagement(self.context)
        for index, object in enumerate(om.getObjectsAsDict()):

            if index == len(objects) - 1:
                object["class"] = "last"
            else:
                object["class"] = "not-last"
            
            objects.append(object)
            
        return objects